package hk.linkcredit.awardservice.award.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import hk.linkcredit.awardservice.award.domain.entity.AwardRecord;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 奖励订单Service接口
 *
 * @author african-loan
 * @date 2022-06-22
 */
public interface IAwardRecordService extends IService<AwardRecord>{
    /**
     * 查询奖励订单
     *
     * @param id 奖励订单ID
     * @return 奖励订单
     */
    public AwardRecord selectAwardRecordById(Long id);

    /**
     * 查询奖励订单列表
     *
     * @param awardRecord 奖励订单
     * @return 奖励订单集合
     */
    public List<AwardRecord> selectAwardRecordList(AwardRecord awardRecord);

    /**
     * 新增奖励订单
     *
     * @param awardRecord 奖励订单
     * @return 结果
     */
    public int insertAwardRecord(AwardRecord awardRecord);

    /**
     * 修改奖励订单
     *
     * @param awardRecord 奖励订单
     * @return 结果
     */
    public int updateAwardRecord(AwardRecord awardRecord);

    /**
     * 批量删除奖励订单
     *
     * @param ids 需要删除的奖励订单ID
     * @return 结果
     */
    public int deleteAwardRecordByIds(Long[] ids);

    /**
     * 删除奖励订单信息
     *
     * @param id 奖励订单ID
     * @return 结果
     */
    public int deleteAwardRecordById(Long id);

    BigDecimal getAmountSum(String userId);

    JSONObject getUserRecordInfo(String userId);

    Map<String, JSONObject>  getUserInviteRecord(String userId);

    long rewardedTotal(String bvnAccount, Long actId, Long awardConfigId);

    Object awardDistribution(List<AwardRecord> recordList);
}
